package com.heima.apis.wemedia;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmNews;
import com.heima.model.wemedia.pojos.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author ZhangXiXi
 * @Description TODO
 * @date 2021/2/20 15:12
 * @Version 1.0
 */
@FeignClient("leadnews-wemedia")
public interface IWemediaClient {

    @PostMapping("/api/v1/user/save")
    public ResponseResult save(@RequestBody WmUser wmUser);

    @GetMapping("/api/v1/user/findByName/{name}")
    public WmUser findWmUserByName(@PathVariable("name") String name);

    @GetMapping("/api/v1/news/findOne/{id}")
    public WmNews findNewsById(@PathVariable("id") Integer id);

    @PostMapping("/api/v1/news/update")
    public ResponseResult updateWmNews(@RequestBody WmNews wmNews);

    @GetMapping("/api/v1/user/findOne/{id}")
    public WmUser findByUserId(@PathVariable("id") Integer id);
}
